﻿<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>在线考试系统</title>
    <!-- bootstrap 3.0.2 -->
    <link th:href="@{/resource/css/bootstrap.min.css}" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link th:href="@{/resource/css/style.css}" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" th:href="@{/resource/js/jQueryMessage/css/message.skin.css}" />
</head>

<body>
	<div class="row">
	    <div class="col-md-12">
	    	<h1 class="panel-heading">添加试卷</h1>
	        <!--breadcrumbs start -->
	        <ul class="breadcrumb">
				<li><a href="/admin/dashboard/toIndex"><i class="fa fa-home"></i> 首页</a></li>
				<li class="active">添加试卷</li>
			</ul>
	        <!--breadcrumbs end -->
	    </div>
	</div>
	<div class="row" id="testPaperDiv">
		<div class="col-lg-12">
			<section class="panel">
				<div class="panel-body">
					<button class="btn btn-primary btn-addon btn-sm" @click="randomSelect">
						<i class="fa fa-plus"></i>随机选题
					</button>
					<button class="btn btn-primary btn-addon btn-sm" @click="manualSelect">
						<i class="fa fa-plus"></i>手动选题
					</button>
				</div>
				<div class="panel-body">
					<form class="col s12" id="questionFrom" enctype="multipart/form-data" th:action="@{/questionManager/addOneQuestion}"
						  onsubmit="return validateForm();" method="post">
						<div class="form-group form-control-medium">
							<label for="paperTitle">标题：</label>
							<textarea id="paperTitle" name="paperTitle" class="form-control" v-model="paperTitle" ></textarea>
							<!--<input id="content" name="content" type="text" class="form-control"/>-->
						</div>

						<div class="panel-body table-responsive">
							<table class="table table-hover">
								<thead>
							<tr>
								<th style="width:50px;">序号</th>
								<th style="width:80px;">题目</th>
								<th style="width:300px;">操作</th>
							</tr>
							</thead>
								<tbody>
								<tr v-for="question in questionList">
									<td>
										<label>{{ question.order }}</label>
										<input type="hidden" :value="question.id" />
									</td>
									<td><label>{{ question.content }}</label></td>
									<td>删除</td>
								</tr>
								</tbody>
							</table>
						</div>

						<div class="form-btn-group-left">
			            	<button type="button" class="btn btn-info" @click="saveTestPaper">保存</button>
							<!--@click="onSubmit"-->
			            </div>
					</form>
				</div>
			</section>
		</div>
	</div>
	<script th:src="@{/resource/js/jquery.min.js}" type="text/javascript"></script>
    <script type="text/javascript" th:src="@{/resource/js/jQueryMessage/js/jquery.plugin.message.js}"></script>
	<!--引入VUE-->
	<script th:src="@{/resource/js/vue.min.js}" type="text/javascript"></script>
	<script th:src="@{/resource/js/axios.min.js}" type="text/javascript"></script>
	<script th:src="@{/resource/js/testPaperManager/testPaperAdd.js}" type="text/javascript"></script>
    <script type="text/javascript">

    </script>
</body>
</html>
